package com.cskaoyan.mapper;

import com.cskaoyan.bean.CouponUser;
import com.cskaoyan.bean.CouponUserListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author
 * @date 2020/12/5 15:21
 */
@Mapper
public interface CouponUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(CouponUser record);

    int insertSelective(CouponUser record);

    CouponUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CouponUser record);

    int updateByPrimaryKey(CouponUser record);

    List<CouponUser> selectList(@Param("couponId") Integer couponId, @Param("userId") Integer userId, @Param("status") Integer status, @Param("sortAndOrder") String sortAndOrder);

    int selectUserCoupon(@Param("userId") Integer userId, @Param("couponId") Integer couponId);

    List<CouponUserListVO> selectMyList(@Param("userId") Integer userId, @Param("status") Integer status);

    List<CouponUserListVO> selectCanUseCoupon(@Param("nowDate") Date nowDate, @Param("userId") Integer userId, @Param("price") BigDecimal price);
}
